package com.twu.biblioteca;

import java.io.PrintStream;

public class ReserveBookCommand implements Command {
    private Library library;
    private UserQueryHandler query;
    private PrintStream ps;

    public ReserveBookCommand(Library library, UserQueryHandler query, PrintStream ps) {
        this.library=library;
        this.query = query;
        this.ps = ps;
    }

    @Override
    public void run() {
        String requestedBook = query.userForString("Please enter the name of the book that you would like to reserve.");
        ps.println(library.attemptToReserve(requestedBook));
    }
}
